require 'logger'
if ENV["test"] == "true"
	$logger = Logger.new("log/test.log")
	$request_logger = Logger.new(File.open("log/request-test.log","w"))
else
	$request_logger = Logger.new(STDOUT)
	$request_logger.instance_variable_get(:@default_formatter).instance_eval {
	  self.class::Format = self.class::Format.sub(/\n$/,'')
	}
	$logger = Logger.new(STDOUT)
	$request_logger.debug("no newline following this message")
	$logger.debug("newline following this message")
end
if ENV["loglevel"]
#      DEBUG < INFO < WARN < ERROR < FATAL < UNKNOWN
	$logger.level = Logger::ENV["loglevel"].constantize
end
